
$(function() {
	
	Tip.emp('负责人');
	
	_change("input[id='category']:visible", "select[id^='category_t']:visible");
	
	$("input[id='code']:visible").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: 'info.php?do=Service.ajax_code',
				dataType: "json",
				data: {
					featureClass: "P",
					style: "full",
					maxRows: 12,
					q: request.term
				},
				success: function( data ) {
					response( $.map( data, function( item ) {
						return {
							label: item.code + " [" + item.name + ", " + item.category + "]",
							value: item.code + ":" + item.name
						}
					}));
				}
			});
		},
		
		minLength: 1
	});
	 
	$('textarea').css("width", 320);
});